// <copyright file="AnalyticsCategoryEditor.cs" company="Microsoft Corporation">
// Copyright (c) 2009 Microsoft Corporation All Rights Reserved
// </copyright>
// <author>Michael S. Scherotter</author>
// <email>mischero@microsoft.com</email>
// <date>2009-06-05</date>
// <summary>AnalyticsCategoryEditor class definition</summary>

namespace Microsoft.WebAnalytics.Design.Editors
{
    using System;
    using System.Windows;
    using Microsoft.Windows.Design.PropertyEditing;

    /// <summary>
    /// Analytics category editor adds an "Analytics Help" button to the bottom of the "Analytics" property category
    /// </summary>
    public class AnalyticsCategoryEditor : CategoryEditor
    {
        #region Properties
        /// <summary>
        /// Gets a data template using the <see cref="AnalyticsCategoryLayout"/> class
        /// </summary>
        public override System.Windows.DataTemplate EditorTemplate
        {
            get
            {
                var dictionary = Application.LoadComponent(new Uri("Microsoft.WebAnalytics.Design.Editors;component/Editors.xaml", UriKind.Relative)) as ResourceDictionary;

                var dataTemplate = dictionary["AnalyticsCategoryEditor"] as DataTemplate;

                return dataTemplate;
            }
        }

        /// <summary>
        /// Gets the target category for "Analytics"
        /// </summary>
        public override string TargetCategory
        {
            get
            {
                return Properties.Resources.Analytics;
            }
        }
        #endregion

        #region Methods
        /// <summary>
        /// This consumes all "Analytics" properties
        /// </summary>
        /// <param name="propertyEntry">the property entry</param>
        /// <returns>always true</returns>
        public override bool ConsumesProperty(PropertyEntry propertyEntry)
        {
            return true;
        }

        /// <summary>
        /// Gets an image
        /// </summary>
        /// <param name="desiredSize">desired size</param>
        /// <returns>always returns null</returns>
        public override object GetImage(System.Windows.Size desiredSize)
        {
            return null;
        }
        #endregion
    }
}